package cn.byapps.hw.dao;

import cn.byapps.hw.entity.Material;
import cn.byapps.hw.entity.SerialPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface MaterialDao extends JpaRepository<Material, Integer> {
    /**
     * 根据SerialPK实体查询
     */
    @Query("select (u) from Material u where u.serialPK = :serialPK")
    List<Material> getBySerialPK(SerialPK serialPK);
}
